package oceanlife;
import java.util.Random;


public class RandomGen {
	private static long seed;
	private static Random randomSeedGenerator;
	private Random randomGenerator;

	//public static int getRand(int a, int z){
	//	return  (int)getRand(a*1.0,z*1.0);
	//}
	
	public RandomGen(long seed){
		randomGenerator = new Random(seed);
	}
	
	public static void setSeed(long seedinc){
		seed = seedinc;
		randomSeedGenerator = new Random(seed);
	}
	
	public static long getSeed(){
		return seed;
	}
	
	public double getRand(double a, double z){
		double rand = randomGenerator.nextFloat();
		return (rand*(z-a))+a;
	}
	
	public double getRand(){
		return getRand(0.0,1.0);
	}
	
	public int getRandInt(){
		return randomGenerator.nextInt();
	}
	
	public double getGaussian(){
		return randomGenerator.nextGaussian();
	}

	public static RandomGen getNextRandomGen() {
		return new RandomGen(randomSeedGenerator.nextLong());
	}
}
